package others;

import android.graphics.Bitmap;
import android.util.Base64;
import android.widget.Toast;

import com.example.financialsystem.application.MyApplication;

import java.io.ByteArrayOutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;


public class Tools {

    public static void ToastShow(String msg){
        Toast.makeText(MyApplication.getContext(),msg,Toast.LENGTH_LONG).show();
    }

    public static Calendar string2Calendar(String str){
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd");
        try {
            Date date =sdf.parse(str);
            calendar.setTime(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return calendar;
    }

}